home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / Documentation / Development Notes / ODF Examples RoadMap / Linking < prev    next >
Encoding:
Text File  |  1996-04-26  |  3.4 KB  |  70 lines  |  [TEXT/ttxt]

  1. OpenDoc
  2. Development
  3. Framework
  4.                                                                                                                                                                                      
  5. Linking
  6. ODF Release 1                                                                                                                                                             
  7.  
  8.  
  9. Table of Contents
  10. -------------------------
  11. • Linking - ODFDraw, ODFTable
  12. • Paste As menu command - ODFDraw, ODFTable
  13. • Paste As via dragging - ODFDraw
  14. • Show Link Info - ODFTable
  15. • Breaking Links (undoable) - ODFTable
  16. • Link borders -ODFTable
  17. • Link selection -ODFTable
  18.  
  19.  
  20. Linking
  21.  
  22. Some support for linking is present in two of the sample parts, ODFDraw and ODFTable. Here are the differences between the two:
  23. ODFDraw 
  24.    - permits only one link to be created from a given shape 
  25.    - permits creating a link by cmd-dragging
  26.    - doesn't support link selection
  27.    - doesn't show link borders
  28. ODFTable 
  29.    - a cell can be the source for multiple links
  30.    - doesn't allow creating a link by cmd-dragging
  31.    - a link is automatically selected when its cell is selected
  32.    - shows link borders only when the "Show Links" box is checked in the Document Info dialog
  33.  
  34.  
  35. The “Paste As” Menu Command
  36.  
  37. The “Paste As” menu item is enabled by ODF in FW_CFrame::HandleAdjustMenus whenever the clipboard contains a link spec. You may wish to impose more conditions for enabling this command; for example, CTableFrame::DoAdjustMenus doesn't enable pasting when the selected cell is already occupied. 
  38.  
  39. ODFDraw: the Paste As command is undoable, and is implemented in CDrawClipboardCommand. 
  40.  
  41. ODFTable: the Paste As command is undoable, and is implemented in CTableEditCommand.
  42.  
  43.  
  44. Paste As Via Cmd-dragging
  45.  
  46. ODFDraw: see the class CDrawDropCommand. Note that it overrides DoDroppedPasteAs, which is called after the drop/PasteAs has already occurred. Another point of interest is that code for undo/redo of the two PasteAs commands is shared in the CDrawLinkManager methods UndoPasteAs and RedoPasteAs.
  47.  
  48.  
  49. Show Link Info
  50.  
  51. ODFTable: CTableFrame overrides ShowPartInfo to show link info when the selected cell contains a part that's in a link.  See CTableLinkManager::ShowLinkInfo. The appropriate link info dialog is shown in CTableLinkSource::DoLinkInfo, and CTableLink::DoLinkInfo.
  52.  
  53.  
  54. Breaking Links
  55.  
  56. ODFTable: Links may be broken by clicking on the “Break Link” button in the Link Info dialog. The DoLinkInfo methods in CTableLink and CTableLinkSource create the undo-able commands CBreakLinkSourceCommand and CBreakLinkCommand. These command objects are returned to CTableLinkManager::ShowLinkInfo, which executes them.
  57.  
  58.  
  59. Link Borders
  60.  
  61. ODFTable: Link borders are displayed when the "Show Links" box is checked in the Document Info window. (Note: you may have to move the grid lines to get them to show up.) CTableFrame::Draw checks the window's ShowLinks flag, and if it's set, iterates through the links and tells them to draw their link borders. See the override methods DoCreateLinkBorderShape and DoDrawLinkBorder in CTableLink and CTableLinkSource for an example of drawing link borders.
  62.  
  63.  
  64. Link Selection
  65.  
  66. ODFTable: Links are automatically selected when their cell is selected. Selecting a link by clicking on its border is not yet implemented.
  67.  
  68.  
  69. © 1993 - 1996 Apple Computer, Inc. All rights reserved.
  70. Apple, the Apple Logo, Macintosh, and OpenDoc are trademarks of Apple Computer, Inc., registered in the United States and other countries.